<template>
	<view>
		<navigation title="订单编辑"></navigation>
		<view class="infoBox">
			<uni-collapse accordion="true">
			   
			     <uni-collapse-item title="合同详情" class="title" v-if="order" :open='true'>
			        <view class="info_box">
			            <view class="con">
			    			<text class="txt1">签约公司</text>	
							<picker mode="selector"  range-key="title" :range="companyList" @change="companyListFn"  data-type="order">
								<input type="text" v-model="order.company_title" placeholder="请输入" />																
							</picker>	
						
			    		</view>
			    		<view class="con">
			    			<text class="txt1">订单类型</text>	
							<picker mode="selector"  range-key="title" :range="newsTypeList" @change="newsTypeListFn"  data-type="order">
								<input type="text" disabled="" v-model="newsTypeList[order.news_type] " placeholder="请输入" />																
							</picker>	
							<!-- <input type="text" v-model="order.news_type" placeholder="请输入" /> -->
			    		</view>
			    		<view class="con">
			    			<text class="txt1">合同编号</text>			    		
							<input type="text" v-model="order.contact_no" placeholder="请输入" />
			    		</view>
			    		<view class="con">
			    			<text class="txt1">签约日期</text>	
							<timeSelector showType="yearToMinute" @btnConfirm="btnConfirm" >
								   <input type="text" disabled="" v-model="order.sign_date" placeholder="请输入" />
							</timeSelector>				
							
			    		</view>
						<view class="con">
							<text class="txt1">举办日期</text>
							<picker mode="date" @change="bindDateChange">								
								<text>{{order.event_date}}</text>
							</picker>
							
						</view>
						<view class="con">
							<text class="txt1">酒店名称</text>							
							<input type="text" v-model="order.hotel_text" placeholder="请输入" />
						</view>
						<view class="con">
							<text class="txt1">合作模式</text>	
							<picker mode="selector"  range-key="title" :range="cooperationModeList" @change="cooperationModeListFn"  data-type="order">
								<input type="text" disabled="" v-model="cooperationModeList[order.cooperation_mode] " placeholder="请输入" />																
							</picker>	
				
						</view>
						<view class="con">
							<text class="txt1">积分</text>							
							<input type="text" v-model="order.score" placeholder="请输入" />
						</view>
						<view class="con">
							<text class="txt1">宴会厅</text>							
							<input type="text" v-model="order.banquet_hall_name" placeholder="请输入" />
						</view>
						<view class="con">
							<text class="txt1">引流销售</text>							
							<input type="text" v-model="order.recommend_salesman" placeholder="请输入" />
						</view>
						<view class="con">
							<text class="txt1">签约销售</text>							
							<input type="text" v-model="order.salesman_realname" placeholder="请输入" />
						</view>
						<view class="con">
							<text class="txt1">新郎</text>							
							<input type="text" v-model="order.bride" placeholder="请输入" />
						</view>
						<view class="con">
							<text class="txt1">手机号</text>							
							<input type="text" v-model="order.bride_mobile" placeholder="请输入" />
						</view>
						<view class="con">
							<text class="txt1">新娘</text>							
							<input type="text" v-model="order.bridegroom" placeholder="请输入" />
						</view>
						<view class="con">
							<text class="txt1">手机号</text>							
							<input type="text" v-model="order.bridegroom_mobile" placeholder="请输入" />
						</view>
			    		<view class="remark">
			    			<text class="txt1">备注</text>			    			
							<input type="text" v-model="order.remark" placeholder="请输入" />
			    		</view>
			        </view>
			    </uni-collapse-item>
				
			 <uni-collapse-item title="酒店服务项目" class="title" v-if="hotelItem" :open='true' >
			        <view class="info_box">
			            <view class="con">
			    			<text class="txt1">婚房数量</text>			    		
							<input type="text" v-model="hotelItem.wedding_room_amount" placeholder="请输入" />
			    		</view>
			    		<view class="con">
			    			<text class="txt1">婚房价格</text>			    			
							<input type="text" v-model="hotelItem.wedding_room" placeholder="请输入" />
			    		</view>
			    		<view class="con">
			    			<text class="txt1">停车位数量</text>			    			
							<input type="text" v-model="hotelItem.part_amount" placeholder="请输入" />
			    		</view>
			    		<view class="con">
			    			<text class="txt1">停车位价格</text>			    			
							<input type="text" v-model="hotelItem.part" placeholder="请输入" />
			    		</view>
			    		<view class="con">
			    			<text class="txt1">香槟数量</text>
							<input type="text" v-model="hotelItem.champagne_amount" placeholder="请输入" />			    			
			    		</view>
						<view class="con">
							<text class="txt1">香槟价格</text>							
							<input type="text" v-model="hotelItem.champagne" placeholder="请输入" />			    			
						</view>
						<view class="con">
							<text class="txt1">茶歇数量</text>							
							<input type="text" v-model="hotelItem.tea_amount" placeholder="请输入" />			    			
						</view>
						<view class="con">
							<text class="txt1">茶歇价格</text>							
							<input type="text" v-model="hotelItem.tea" placeholder="请输入" />			    			
						</view>
						<view class="con">
							<text class="txt1">糕点数量</text>							
							<input type="text" v-model="hotelItem.cake_amount" placeholder="请输入" />			    			
						</view>
						<view class="con">
							<text class="txt1">糕点价格</text>							
							<input type="text" v-model="hotelItem.cake" placeholder="请输入" />			    			
						</view>
			        </view>
			 </uni-collapse-item>
			<uni-collapse-item title="婚宴" class="title" v-if="banquet" :open='true' >
				<view class="info_box">
					<view class="con">
						<text class="txt1">订单所属公司</text>	
						<picker @change="banquet_chooseCompany"  range-key="title" :range="companyList">									    		
							<input type="text" disabled v-model="banquet.company_title" placeholder="请输入" />
						</picker>
					</view>
					<view class="con">
						<text class="txt1">婚宴总金额</text>			    			
						<input type="text" v-model="banquet.banquet_totals" placeholder="请输入" />
					</view>
					<view class="con">
						<text class="txt1">桌数</text>			    			
						<input type="text" v-model="banquet.table_amount" placeholder="请输入" />
					</view>
					<view class="con">
						<text class="txt1">餐标</text>			    			
						<input type="text" v-model="banquet.table_price" placeholder="请输入" />
					</view>
					<view class="con">
						<text class="txt1">服务费总计</text>
						<input type="text" v-model="banquet.service_fee" placeholder="请输入" />			    			
					</view>
					<view class="con">
						<text class="txt1">酒水费用</text>							
						<input type="text" v-model="banquet.wine_fee" placeholder="请输入" />			    			
					</view>
					<view class="con">
						<text class="txt1">加菜换菜</text>							
						<input type="text" v-model="banquet.banquet_update_table" placeholder="请输入" />			    			
					</view>
					<view class="con">
						<text class="txt1">仪式</text>
						<picker @change="banquet_ritualList"  range-key="title" :range="ritualList">
						   <input type="text" disabled v-model="banquet.banquet_ritual_title" placeholder="请输入" />			    			
						</picker>	
					</view>
					<view class="con">
						<text class="txt1">仪式价格</text>							
						<input type="text" v-model="banquet.banquet_ritual_hall" placeholder="请输入" />			    			
					</view>
					<view class="con">
						<text class="txt1">其他</text>							
						<input type="text" v-model="banquet.banquet_other" placeholder="请输入" />			    			
					</view>
					<view class="con">
						<text class="txt1">备注</text>							
						<input type="text" v-model="banquet.banquet_remark" placeholder="请输入" />			    			
					</view>					
				</view>				 
			</uni-collapse-item>
			<uni-collapse-item title="婚庆" class="title" v-if="wedding" :open='true'>
				<view class="info_box">
					<view class="con">
						<text class="txt1">订单所属公司</text>
					    <picker @change="wedding_chooseCompany"  range-key="title" :range="companyList">	
						  <input type="text" v-model="wedding.company_title" placeholder="请输入" />					    
					    </picker>
					</view>
					<view class="con">
						<text class="txt1">婚庆总金额</text>			    			
						<input type="text" v-model="wedding.wedding_totals" placeholder="请输入" />
					</view>
					<view class="con">
						<text class="txt1">套餐</text>	
						<picker @change="wedding_combo"  range-key="title" :range="packageList">
						   <input type="text" v-model="wedding.wedding_package_title" placeholder="请输入" />
						</picker>
					</view>
					<view class="con">
						<text class="txt1">婚庆套餐价</text>			    			
						<input type="text" v-model="wedding.wedding_package_price" placeholder="请输入" />
					</view>
				
					<view class="con">
						<text class="txt1">仪式</text>		
						<picker @change="wedding_ritualList"  range-key="title" :range="ritualList">
						    <input type="text" v-model="wedding.wedding_ritual_title" placeholder="请输入" />			    			
						</picker>
					</view>
					<view class="con">
						<text class="txt1">仪式价格</text>							
						<input type="text" v-model="wedding.wedding_ritual_hall" placeholder="请输入" />			    			
					</view>
					<view class="con">
						<text class="txt1">是否研发产品</text>
						<picker @change="wedding_iswhether"  :range="esearchType">
						   <input type="text" disabled  :value="wedding.is_new_product===1?'是':'否'" placeholder="请输入" />												  
						</picker>
					</view>
					<view class="con">
						<text class="txt1">研发产品编号</text>													
						<input type="text" v-model="wedding.new_product_no" placeholder="请输入" />			    									
					</view>
					<view class="con">
						<text class="txt1">其他</text>							
						<input type="text" v-model="wedding.wedding_other" placeholder="请输入" />			    			
					</view>
					<view class="con">
						<text class="txt1">备注</text>							
						<input type="text" v-model="wedding.wedding_remark" placeholder="请输入" />			    			
					</view>					
				</view>	
			</uni-collapse-item>
			
				<uni-collapse-item title="婚车" class="title " v-if="carList"  :open='true'>
					<view class="wine"  >
						<view class="info_box">
							<view class="name">婚车</view>
							<view class="con">
								<text class="txt1">是否主车</text>
								<picker mode="selector" :value="carList.is_master" range-key="title" :range="isMianCar" @change="changeCar"  >
									<text>{{ isMianCar[carList.is_master].title}}</text>
								</picker>
								
							</view>
						    <view class="con">
								<text class="txt1">婚车品牌</text>
								<picker mode="selector"  range-key="title" :range="pickerList" @change="bindTimeChange"  data-type="carList">
									<input type="text" v-model="carList.title" placeholder="请输入" />																
								</picker>	
															
							</view>
					
							<view class="con">
								<text class="txt1">婚车数量</text>
								<input type="text" v-model="carList.car_id" placeholder="请输入" />
								
							</view>
							
							<view class="con">
								<text class="txt1">婚车价格</text>
								<input type="text" v-model="carList.car_price" placeholder="请输入" />								
							</view>
							
							<view class="remark">
								<text class="txt1">备注</text>								
								<input type="text" v-model="carList.car_remark" placeholder="请输入" />
							</view>
						</view>
					</view>
				</uni-collapse-item>
				
				 <uni-collapse-item title="酒水" class="title " v-if="wineList"  :open='true'>
					<view class="wine" >
						<view class="info_box">
							<view class="name">酒水</view>
						    <view class="con">
								<text class="txt1">酒水品牌</text>	
								<picker mode="selector"  range-key="title" :range="pickerList" @change="bindTimeChange"  data-type="wineList">
									<input type="text" disabled v-model="wineList.title" placeholder="请输入" />																
								</picker>	
								
							</view>
					
							<view class="con">
								<text class="txt1">酒水数量</text>
								<input type="text" v-model="wineList.wine_amount" placeholder="请输入" />								
							</view>
							
							<view class="con">
								<text class="txt1">酒水价格</text>								
								<input type="text" v-model="wineList.wine_price" placeholder="请输入" />
							</view>
							
							<view class="remark">
								<text class="txt1">备注</text>
								<input type="text" v-model="wineList.wine_remark" placeholder="请输入" />								
							</view>
						</view>
					</view>
				</uni-collapse-item>
				
				<uni-collapse-item title="喜糖" class="title " v-if="sugarList" :open='true'> 
					<view class="suger" >
						<view class="info_box">
							<view class="name">喜糖</view>
						    <view class="con">
								<text class="txt1">喜糖品牌</text>
								<picker mode="selector"  range-key="title" :range="pickerList" @change="bindTimeChange"  data-type="sugarList">
									<input type="text" disabled v-model="sugarList.title" placeholder="请输入" />																
								</picker>	
																								
							</view>
	
							<view class="con">
								<text class="txt1">喜糖数量</text>
								<input type="text" v-model="sugarList.sugar_amount" placeholder="请输入" />								
							</view>
							
							<view class="con">
								<text class="txt1">喜糖价格</text> 								
								<input type="text" v-model="sugarList.sugar_price" placeholder="请输入" />
							</view>
							
							<view class="remark">
								<text class="txt1">备注</text>								
								<input type="text" v-model="sugarList.sugar_remark" placeholder="请输入" />
							</view>
						</view>
					</view>
				</uni-collapse-item>
				
				<uni-collapse-item title="糕点" class="title dessert" v-if="dessertList" :open='true'>
					<view class="dessert" >
						<view class="info_box">
							<view class="name">糕点</view>
						    <view class="con">
								<text class="txt1">糕点品牌</text>
								<picker mode="selector"  range-key="title" :range="pickerList" @change="bindTimeChange"  data-type="dessertList">
									<input type="text" disabled v-model="dessertList.title" placeholder="请输入" />																
								</picker>								
							</view>
					
							<view class="con">
								<text class="txt1">糕点数量</text>
								<input type="text" v-model="dessertList.dessert_amount" placeholder="请输入" />								
							</view>
							
							<view class="con">
								<text class="txt1">糕点价格</text>								
								<input type="text" v-model="dessertList.dessert_price" placeholder="请输入" />
							</view>
							
							<view class="remark">
								<text class="txt1">备注</text>								
								<input type="text" v-model="dessertList.dessert_remark" placeholder="请输入" />
							</view>
						</view>
					</view>
				</uni-collapse-item>
				
				<uni-collapse-item title="灯光" class="title light"  v-if="lightList" :open='true'>
					<view class="light" >
						<view class="info_box">
							<view class="name">灯光</view>
						    <view class="con">
								<text class="txt1">灯光品牌</text>
								<picker mode="selector"  range-key="title" :range="pickerList" @change="bindTimeChange"  data-type="lightList">
									<input type="text" disabled v-model="lightList.title" placeholder="请输入" />																
								</picker>
															
							</view>
					
							<view class="con">
								<text class="txt1">灯光数量</text>								
								<input type="text" v-model="lightList.light_amount" placeholder="请输入" />
							</view>
							
							<view class="con">
								<text class="txt1">灯光价格</text>
								<input type="text" v-model="lightList.light_price" placeholder="请输入" />								
							</view>
							
							<view class="remark">
								<text class="txt1">备注</text>
								<input type="text" v-model="lightList.light_remark" placeholder="请输入" />								
							</view>
						</view>
					</view>
				</uni-collapse-item>
				
				<uni-collapse-item title="Led" class="title led" v-if="ledList" :open='true'>
					<view class="led" >
						<view class="info_box">
							<view class="name">Led</view>
						    <view class="con">
								<text class="txt1">Led品牌</text>
								<picker mode="selector"  range-key="title" :range="pickerList" @change="bindTimeChange"  data-type="ledList">
									<input type="text" disabled v-model="ledList.title" placeholder="请输入" />																
								</picker>
							</view>
					
							<view class="con">
								<text class="txt1">Led数量</text>
								<input type="text" v-model="ledList.led_amount" placeholder="请输入" />								
							</view>
							
							<view class="con">
								<text class="txt1">Led价格</text>
								<input type="text" v-model="ledList.led_price" placeholder="请输入" />								
							</view>
							
							<view class="remark">
								<text class="txt1">备注</text>
								<input type="text" v-model="ledList.led_remark" placeholder="请输入" />								
							</view>
						</view>
					</view>
				</uni-collapse-item>
				
				<uni-collapse-item title="3D" class="title " v-if="d3List"  :open='true'>
					<view class="d3" >
						<view class="info_box">
							<view class="name">3D</view>
						    <view class="con">
								<text class="txt1">3D品牌</text>
								<picker mode="selector"  range-key="title" :range="pickerList" @change="bindTimeChange"  data-type="d3List">								
									<input type="text" disabled v-model="d3List.title" placeholder="请输入" />																
								</picker>
								
							</view>
					
							<view class="con">
								<text class="txt1">3D数量</text>
								<input type="text" v-model="d3List.d3_amount" placeholder="请输入" />																								
							</view>
							
							<view class="con">
								<text class="txt1">3D价格</text>
								<input type="text" v-model="d3List.d3_price" placeholder="请输入" />																																
							</view>
							
							<view class="remark">
								<text class="txt1">备注</text>
								<input type="text" v-model="d3List.d3_remark" placeholder="请输入" />								
							</view>
						</view>
					</view>
				</uni-collapse-item>
				
				<uni-collapse-item title="合同总金额" class="title " v-if="contractPrice" :open='true'>
					<view class="d3"  >
						<view class="info_box">
							<view class="name">
								<view class="name">合同总金额</view>								
							</view>
							<view class="con" >
								<text class="txt1">定金收款时间</text>
								<timeSelector showType="yearToMinute"  @btnConfirm="contractBtnConfirm" >
									   <input type="text" disabled="" v-model="contractPrice.earnest_money_date" placeholder="请输入" />
								</timeSelector>																
							</view>					
							<view class="con" >
								<text class="txt1">定金收款金额</text>								
								<input type="text"  v-model="contractPrice.earnest_money" placeholder="请输入" />	
							</view>							
							<view class="con" >
								<text class="txt1">中款收款时间</text>								
								<timeSelector showType="yearToMinute"  @btnConfirm="middleBtnConfirm" >
									   <input type="text" disabled="" v-model="contractPrice.middle_money_date" placeholder="请输入" />
								</timeSelector>										
							</view>							
							<view class="con" >
								<text class="txt1">中款收款金额</text>								
								<input type="text"  v-model="contractPrice.middle_money" placeholder="请输入" />
							</view>
							<view class="con" >
								<text class="txt1">中款尾款时间</text>	
								<timeSelector showType="yearToMinute"  @btnConfirm="tail_moneyBtnConfirm" >
									   <input type="text" disabled="" v-model="contractPrice.tail_money_date" placeholder="请输入" />
								</timeSelector>									
							</view>
							<view class="con" >
								<text class="txt1">中款尾款金额</text>								
								<input type="text"  v-model="contractPrice.tail_money" placeholder="请输入" />
							</view>
						</view>
					</view>
				</uni-collapse-item>
					
				<uni-collapse-item title="收据编号" class="title " v-if="incomeList"  :open='true'>
					<view class="d3"  >
						<view class="info_box">
							<view class="name">
								<view class="name">收据编号</view>								
							</view>
							<view class="con">
								<text class="txt1">收款类目</text>
								<picker mode="selector"  range-key="title" :range="incomePaymentList" @change="income_categoryFn"  data-type="order">
									<input type="text" disabled="" v-model="incomeList.income_category " placeholder="请输入" />																
								</picker>												
							</view>					
							<view class="con">
								<text class="txt1">收款方式</text>		
								<picker mode="selector"  range-key="title" :range="incomePaymentList" @change="incomePaymentListFn"  data-type="order">
									<input type="text" disabled="" v-model="incomeList.income_payment_text " placeholder="请输入" />																
								</picker>									
							</view>							
							<view class="con">
								<text class="txt1">收款性质</text>
								<picker mode="selector"  range-key="title" :range="incomeTypeList" @change="income_type_textFn"  data-type="order">
									<input type="text" disabled="" v-model="incomeList.income_type_text " placeholder="请输入" />																
								</picker>								
							</view>							
							<view class="con">
								<text class="txt1">收款时间</text>
								<timeSelector showType="yearToMinute"  @btnConfirm="income_date_moneyBtnConfirm" >
									   <input type="text" disabled="" v-model="incomeList.income_date" placeholder="请输入" />
								</timeSelector>										
							</view>
							<view class="con">
								<text class="txt1">实际收款时间</text>
								<timeSelector showType="yearToMinute"  @btnConfirm="income_real_date_moneyBtnConfirm" >
									   <input type="text" disabled="" v-model="incomeList.income_real_date" placeholder="请输入" />
								</timeSelector>									
							</view>
							<view class="con">
								<text class="txt1">收款备注</text>
								<input type="text"  v-model="incomeList.income_remark" placeholder="请输入" />								
							</view>
						</view>
					</view>
				</uni-collapse-item>
				<uni-collapse-item title="付款信息" class="title " v-if="paymentList"  :open='true'>
					<view class="d3"  >
						<view class="info_box">
							<view class="name">
								<view class="name">付款编号</view>
								
							</view>
							<view class="con">
								<text class="txt1">付款类目</text>
								<text class="txt2">{{paymentList.pay_category}}</text>
							</view>					
							<view class="con">
								<text class="txt1">付款性质</text>
								<picker mode="selector"  range-key="title" :range="payTypeList" @change="payTypeListFn"  data-type="order">
									<input type="text" disabled="" v-model="paymentList.pay_type_text " placeholder="请输入" />																
								</picker>							
							</view>							
							<view class="con">
								<text class="txt1">付款申请日期</text>
								<timeSelector showType="yearToMinute"  @btnConfirm="apply_pay_dateFn" >
									   <input type="text" disabled="" v-model="paymentList.apply_pay_date" placeholder="请输入" />
								</timeSelector>										
							</view>							
							<view class="con">
								<text class="txt1">实际付款日期</text>
								<timeSelector showType="yearToMinute"  @btnConfirm="pay_real_dateFn" >
									   <input type="text" disabled="" v-model="paymentList.pay_real_date" placeholder="请输入" />
								</timeSelector>										
							</view>
							<view class="con">
								<text class="txt1">付款金额</text>
								<input type="text"  v-model="paymentList.pay_item_price" placeholder="请输入" />
								
							</view>
							<view class="con">
								<text class="txt1">付款备注</text>
								<input type="text"  v-model="paymentList.payment_remark" placeholder="请输入" />
								
							</view>
						</view>
					</view>
				</uni-collapse-item>
				
				<uni-collapse-item title="婚宴增项" class="title " v-if="banquetSuborderList"  :open='true'>
					<view class="d3"  >
						<view class="info_box">
							<view class="name">
								<view class="name">婚宴增项</view>								
							</view>
							<view class="con">
								<text class="txt1">桌数</text>
								<input type="text"  v-model="banquetSuborderList.table_amount" placeholder="请输入" />																
							</view>					
							<view class="con">
								<text class="txt1">餐标</text>
								<input type="text"  v-model="banquetSuborderList.table_price" placeholder="请输入" />									
							</view>							
							<view class="con">
								<text class="txt1">增项小计</text>
								<input type="text"  v-model="banquetSuborderList.banquet_totals" placeholder="请输入" />									
								
							</view>							
							<view class="con">
								<text class="txt1">签单销售</text>
								<input type="text"  v-model="banquetSuborderList.salesman" placeholder="请输入" />			
								
							</view>
							<view class="con">
								<text class="txt1">备注</text>
								<input type="text"  v-model="banquetSuborderList.sub_banquet_remark" placeholder="请输入" />										
							</view>							
						</view>
					</view>
				</uni-collapse-item>
				
				<uni-collapse-item title="婚庆增项" class="title " v-if="weddingSuborderList" :open='true'>
					<view class="d3"   >
						<view class="info_box">
							<view class="name">
								<view class="name">婚庆增项</view>								
							</view>
							<view class="con">
								<text class="txt1">订单号</text>
								<input type="text"  v-model="weddingSuborderList.wedding_order_no" placeholder="请输入" />	
							</view>			
							<view class="con">
								<text class="txt1">增项小计</text>
								<input type="text"  v-model="weddingSuborderList.wedding_totals" placeholder="请输入" />											
							</view>														
							<view class="con">
								<text class="txt1">备注</text>
								<input type="text"  v-model="weddingSuborderList.sub_wedding_remark" placeholder="请输入" />											
							</view>								
						</view>
					</view>
				</uni-collapse-item>
			</uni-collapse> 
		</view>

		<!-- 审批流程结束 -->
		<button type="default" class="btn" @click="saveFn()"> 保存</button>
	</view>
</template>

<script>
	import timeSelector from '@/component/wing-time-selector/wing-time-selector.vue';
	import navigation from "@/component/navigation.vue"
	import sun from '@/utils/sun.js'
	export default {
		components: {
			navigation,
			timeSelector
		},
		data() {
			return {
				esearchType:['否','是'],//研发产品
				options:'',
				member:"",//客人信息
				order:'',//合同详情
				hotelItem:'',//酒店详情
				wedding:'',//
				banquet:'',//
				sugarList:'',//喜糖
				carList:'',//婚车
				wineList:'',//酒水				
				dessertList:'',//糕点
				lightList:'',//灯光
				ledList:'',//Led
				d3List:'',//3d
				contractPrice:'',//
				incomeList:'',
				paymentList:'',
				banquetSuborderList:'',//
				weddingSuborderList:'',// 
				
				confirmList:'',//审核流程
				isEdit:'',//是否可以编辑
				pickerList:[],//picker
				isMianCar:[{id:0,title:"否"},{id:1,title:"是"}],//是否是主车
				
				companyList:[],//签约公司
				cooperationModeList:[],//合作模式
				newsTypeList:[],//婚宴信息
			    
				payTypeList:'',//性质
				incomePaymentList:'',//收款方式
				incomeTypeList:"",//收款性质
				
				packageList:'',
				ritualList:'',
				
			}
		},
		onLoad(options) {
			
			this.options =JSON.parse(options.data);			
			this.getData( this.options)
			if(this.options.picker){
				//获取筛选
				this.getSearch(this.options)
			}
			
			// this.flowData({id:options.id})//流程
		},
		methods: {
			getData(e){				
			  let that=this										
			  sun.request({
				url: e.read,
				showLoading: true,
				token:true,
				data:{
					id:e.id,
					income_category:e.income_category?e.income_category:'',
				},
				success(res) {				
						if(res.code==200){			
						that.order= res.data.order?res.data.order:'';
						if(that.order){
							that.companyList = res.data.companyList;						
							that.cooperationModeList = res.data.cooperationModeList;
							that.newsTypeList =  res.data.newsTypeList
						}
						that.wedding = res.data.wedding?res.data.wedding:'';
						that.banquet = res.data.banquet?res.data.banquet:''; 
						if(that.wedding || that.banquet){
							that.companyList=res.data.companyList;
							that.packageList = res.data.packageList;
							that.ritualList = res.data.ritualList;
						}
						that.hotelItem = res.data.detail?res.data.detail:'';
						that.sugarList = res.data.detail?res.data.detail:'';
						that.carList = res.data.carList?res.data.carList:'';
						that.wineList = res.data.wineList?res.data.wineList:'';
						that.sugarList = res.data.sugarList?res.data.sugarList:'';
						that.dessertList = res.data.dessertList?res.data.dessertList:'';
						that.lightList = res.data.lightList?res.data.lightList:"";
						that.ledList = res.data.ledList?res.data.ledList:"";
						that.d3List = res.data.d3List?res.data.d3List:'';					
						that.contractPrice = res.data.contractPrice?res.data.contractPrice:'';					
						that.incomeList = res.data.income?res.data.income:'';									    
						if( that.incomeList){
							that.incomePaymentList=res.data.incomePaymentList;//收款方式
							that.incomeTypeList=res.data.incomeTypeList//收款性质
						}
						that.paymentList = res.data.paymentList?res.data.paymentList:'';	
						if( that.paymentList){						
							that.payTypeList=res.data.payTypeList//收款性质							
					    }
						that.banquetSuborderList = res.data.banquetSuborderList?res.data.banquetSuborderList:'';
						that.weddingSuborderList = res.data.weddingSuborderList?res.data.weddingSuborderList:'';
				   }
				},
				fail(e) {
					uni.showToast({
						icon: "none",
						title: "服务器开小差去啦~",
					})
				}
			  })
						  
			},
			//获取筛选
			getSearch(e){
			  let that=this										
			  sun.request({
				url: e.picker,
				showLoading: true,
				token:true,
				data:{
					
				},
				success(res) {				
					if(res.code==200){
			          that.pickerList=res.data.pickerList					  
					}
				},
				fail(e) {
					uni.showToast({
						icon: "none",
						title: "服务器开小差去啦~",
					})
				}
			  })
						  
			},
			//审核流程
			flowData(e){
			  let that=this										
			  sun.request({
				url: "/h5/order.confirm/getConfirmStep",
				showLoading: true,
				token:true,
				data:{
					id:e.id
				},
				success(res) {				
					if(res.code==200){						
					  that.confirmList = res.data.confirmList;
					  that.isEdit = res.data.isEdit;
					}
				},
				fail(e) {
					uni.showToast({
						icon: "none",
						title: "服务器开小差去啦~",
					})
				}
			  })
						  
			},
			//右侧修改
			editTextFn(e){
			},
			//保存提交
			saveFn(){
				let that=this
				sun.request({
					url: that.options.api,
					showLoading: true,
					token:true,
					data:{						
						order:that.order?JSON.stringify(that.order):'',						
						wedding:that.wedding?JSON.stringify(that.wedding):'',//
						banquet:that.banquet?JSON.stringify(that.banquet):'',//
						hotelItem:that.hotelItem?JSON.stringify(that.hotelItem):'',//酒店详情
						sugarList:that.sugarList?JSON.stringify(that.sugarList):'',//喜糖
						carList:that.carList?JSON.stringify(that.carList):'',//婚车
						wineList:that.wineList?JSON.stringify(that.wineList):'',//酒水				
						dessertList:that.dessertList?JSON.stringify(that.dessertList):'',//糕点
						lightList:that.lightList?JSON.stringify(that.lightList):'',//灯光
						ledList:that.ledList?JSON.stringify(that.ledList):'',//Led
						d3List:that.d3List?JSON.stringify(that.d3List):'',//3d
						contractPrice:that.contractPrice?JSON.stringify(that.contractPrice):'',//合同金额
						incomeList:that.incomeList?JSON.stringify(that.incomeList):'',//收款
						paymentList:that.paymentList?JSON.stringify(that.paymentList):'',//收款
						banquetSuborderList:that.banquetSuborderList?JSON.stringify(that.banquetSuborderList):'',
						weddingSuborderList:that.weddingSuborderList?JSON.stringify(that.weddingSuborderList):'',
					},
					success(res) {				
						if(res.code==200){						
						  uni.showToast({
						  	icon:"none",
							title:res.msg
						  })
						  // uni.redirectTo({
						  // 	url:"../orderInfo/orderDetail/orderDetail?"
						  // })
						  uni.navigateBack({
						  	delta:1,
							success(){
								
							}
						  })
						  // un.navigateTo({})
						}
					},
					fail(e) {
						uni.showToast({
							icon: "none",
							title: "服务器开小差去啦~",
						})
					}
				})
			},
			// 婚车
			changeCar(e){
				let index =e.detail.value;
				this.carList.is_master = index					
			},
			bindTimeChange(e){
			
				let type = e.currentTarget.dataset.type;
				let index =e.detail.value			
				let that=this
				switch(type) {
					case 'carList':
						that.carList.car_id =that.pickerList[index].id
						that.carList.title =that.pickerList[index].title
						break;
					case 'wineList':
						that.wineList.wine_id =that.pickerList[index].id
						that.wineList.title =that.pickerList[index].title
						break;
					case 'sugarList':
						that.sugarList.sugar_id =that.pickerList[index].id
						that.sugarList.title =that.pickerList[index].title
						break;
					case 'dessertList':
						that.dessertList.dessert_id =that.pickerList[index].id
						that.dessertList.title =that.pickerList[index].title
						break;
					case 'lightList':
						that.lightList.light_id =that.pickerList[index].id
						that.lightList.title =that.pickerList[index].title
						break;
					case 'ledList':
						that.ledList.led_id =that.pickerList[index].id
						that.ledList.title =that.pickerList[index].title
						break;
					case 'd3List':
						that.d3List.d3_id =that.pickerList[index].id;
						that.d3List.title =that.pickerList[index].title;
						break;
									
					default :
				}
				
			
			},
			btnConfirm(e){				
				this.order.sign_date = e.key
			},
			bindDateChange(e){
				this.order.event_date = e.detail.value;				
			},
			//定金时间选择
			contractBtnConfirm(e){		
				this.contractPrice.earnest_money_date = e.ymd;
			},
			//中款
			middleBtnConfirm(e){
				this.contractPrice.middle_money_date = e.ymd;
			},
			//尾款时间
			tail_moneyBtnConfirm(e){
				this.contractPrice.tail_money_date = e.ymd;
			},
			// 收款
			income_date_moneyBtnConfirm(e){
				this.incomeList.income_date = e.ymd;
			},
			income_real_date_moneyBtnConfirm(e){
				this.incomeList.income_real_date = e.ymd;
			},
			//签约公司
			companyListFn(e){
				this.order.company_id = this.companyList[e.detail.value].id;
				this.order.company_title = this.companyList[e.detail.value].title
			},
			//订单类型
			newsTypeListFn(e){				
			   this.order.news_type=e.detail.value;
			},
			// 合作模式e
			cooperationModeListFn(e){
				this.order.cooperation_mode = e.detail.value;
			},
			//收款类目
			income_categoryFn(e){
				let index=e.detail.value
				this.incomeList.income_category= this.incomePaymentList[index].title;				
			},
			//收款方式
			incomePaymentListFn(e){				
				let index=e.detail.value
			    this.incomeList.income_payment_text= this.incomePaymentList[index].title;
				this.incomeList.income_payment= this.incomePaymentList[index].id;
			},
			//收款性质
			income_type_textFn(e){
				let index=e.detail.value;
				this.incomeList.income_type_text= this.incomeTypeList[index].title;
				this.incomeList.income_type= this.incomeTypeList[index].id;
			},
			payTypeListFn(e){
				let index=e.detail.value;
				this.paymentList.pay_type_text= this.payTypeList[index].title;
				this.paymentList.pay_type= this.payTypeList[index].id;
			},
			apply_pay_dateFn(e){
				this.paymentList.apply_pay_date=e.ymd
			},
			pay_real_dateFn(e){
				this.paymentList.pay_real_date=e.ymd
			},
			//所属公司
			banquet_chooseCompany(e){				
				let index = e.detail.value												
				this.banquet.company_id= this.companyList[index].id;
				this.banquet.company_title=this.companyList[index].title;
			},
			//仪式
			banquet_ritualList(e){
				let index = e.detail.value;
				this.banquet.banquet_ritual_id= this.ritualList[index].id;
				this.banquet.banquet_ritual_title=this.ritualList[index].title;
				
			},
			//所属公司
			wedding_chooseCompany(e){
				let index = e.detail.value
				this.wedding.company_id = this.companyList[index].id;
				this.wedding.company_title = this.companyList[index].title;
			},
			//仪式
			wedding_ritualList(e){
				let index = e.detail.value;
				this.wedding.wedding_ritual_id= this.ritualList[index].id;
				this.wedding.wedding_ritual_title=this.ritualList[index].title;
			},
			//是否
			wedding_iswhether(e){				
				let index = e.detail.value;
				this.wedding.is_new_product = index;					
			},
			//套餐
			wedding_combo(e){
				let index = e.detail.value;
				this.wedding.wedding_package_title = this.packageList[index].title
				this.wedding.wedding_package_id = this.packageList[index].id ;	
			}
			
		}
	}
</script>

<style lang="less">
page{
	background: #F4F4F4;
}
.infoBox{
	width: 100%;
	height: auto;
	background: #FFFFFF;
	margin-top: 20upx;
}
.infoBox .title{
	background: #FFFFFF;
}
.info_box{
	width: 100%;
	height: auto;
	background: #FFFFFF;
	padding: 20upx 30upx 40upx 30upx;
	box-sizing: border-box;
	border-top:1upx solid #eeeeee;
	.name{
		width: 100%;
		height: 52upx;
		display: flex;
		align-items: center;
		font-size: 26upx;
		color: #666666;
	}
	.con{
		width: 100%;
		height: 52upx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		font-size: 26upx;
		position: relative;		
		input{
			width: 200upx;
			font-size: 28upx;
		}
		.txt1{
			width: auto;
			height: 100%;
			display: block;
			line-height: 52upx;
			color: #999999;
			float: left;
		}
		.txt2{
			width: auto;
			height: 100%;
			display: block;
			line-height: 52upx;
			color: #666666;
			position: absolute;
			right: 0;
		}
	}
	.remark{
		width: 100%;
		height: 64upx;
		display: flex;
		align-items: center;
		font-size: 26upx;
		margin-top: 20upx;
		position: relative;
		.txt1{
			width: auto;
			height: 100%;
			display: block;
			color: #999999;
			float: left;
		}
		.txt2{
			width: 419upx;
			height: 100%;
			display: block;
			line-height: 32upx;
			color: #666666;
			position: absolute;
			right: 0;
			word-break: break-all;  /* break-all(允许在单词内换行。) */
		    text-overflow: ellipsis;  /* 超出部分省略号 */
			display: -webkit-box; /** 对象作为伸缩盒子模型显示 **/
			-webkit-box-orient: vertical; /** 设置或检索伸缩盒对象的子元素的排列方式 **/
			-webkit-line-clamp: 2; /** 显示的行数 **/
			overflow: hidden;
		}
	}
}



///审批流程
.approval{
	width: 100%;
	height: auto;
	text{
		width: 100%;
		height: 28upx;
		display: block;
		font-size:30upx;
		color: #999999;
		margin-bottom: 50upx;
		padding: 32upx 44upx 0 44upx;
		box-sizing: border-box;
	}
	}
.approver{
	width: 100%;
	height: auto;
	.box{
		width: 100%;
		height: 158upx;
		border-bottom: 1upx solid #eeeeee;
		box-sizing: border-box;
		padding: 0 32upx;
		position: relative;
		.circle{
			width: 25upx;
			height: 25upx;
			background: #D3D3D3;
			border-radius: 50%;
			position: absolute;
			left: 30upx;
			top: 70upx;
		}
		.left{
			  width: 350upx;
			  min-height: 100upx;
			  white-space:normal ;
			  font-size: 32upx;
			  color: #333333;
			  margin-left: 57upx;
			  float: left;
			  
			  .view_text{
				  width: auto;
				  height: auto;
				  display: block;
				  font-size: 26upx;
				  color: #999999;
				  padding: 0;
				  word-break: break-all;
				  text-overflow: ellipsis;
				  display: -webkit-box; /** 将对象作为伸缩盒子模型显示 **/
				  -webkit-box-orient: vertical; /** 设置或检索伸缩盒对象的子元素的排列方式 **/
				  -webkit-line-clamp: 2; /** 显示的行数 **/
				  overflow: hidden;  /** 隐藏超出的内容 **/				  			
			  }
			}
		.right{
			width: auto;
			height: 110upx;
            float: right;
			padding-top: 30upx;
			margin-right:10upx ;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;			
			.image{
				width: 71upx;
				height: 71upx;
				background:#D3D3D3;
				border-radius: 50%;
			}
			text{
				
				height: auto;
				display: block;
                font-size: 26upx;
				color: #999999;
				padding: 0;
				text-align: center;
			}
		}
	}
}

.frist_circle{
	width: 25upx;
	height: 25upx;
	background: #D3D3D3;
	border-radius: 50%;
	position: absolute;
	left: 30upx;
	top: 70upx;
}
.circle::after{
	content: '';
	width: 2upx;
	height: 135upx;
	display: block;
	background: #D3D3D3;
	position: absolute;
	left: 50%;
	bottom: 25upx;
}


.btn{
	width: 100%;
	background: #007AFF;
	border-radius: 30upx;
	border: none;
	color: #FFFFFF;
	position: absolute;
	left: 0;
	bottom: 50upx;
}
</style>
